<template>
    <a-menu id="dddddd" class="menu" v-model:openKeys="openKeys" v-model:selectedKeys="selectedKeys" mode="inline"
        :items="items" @click="handleClick"></a-menu>
</template>
<script setup>
import { reactive, ref, watch, h } from 'vue';
// import { Menu } from 'ant-design-vue';
const selectedKeys = ref(['1']);
const openKeys = ref(['sub1']);
function getItem(label, key, icon, children, type) {
    return {
        key,
        icon,
        children,
        label,
        type,
    };
}
const items = reactive([
    getItem('模型中心', 'g1', null, [getItem('添加模型', '1'), getItem('用户定价', '2'), getItem('查看报告', '3'), getItem('模型状态', '5'), getItem('控制台', '6'), getItem('订单申诉', '7')], 'group'),
    // getItem('Navigation One', 'sub1', () => h(MailOutlined), [
    //     getItem('Item 1', 'g1', null, [getItem('Option 1', '1'), getItem('Option 2', '2')], 'group'),
    //     getItem('Item 2', 'g2', null, [getItem('Option 3', '3'), getItem('Option 4', '4')], 'group'),
    // ]),
    // getItem('Navigation Two', 'sub2', () => h(AppstoreOutlined), [
    //     getItem('Option 5', '5'),
    //     getItem('Option 6', '6'),
    //     getItem('Submenu', 'sub3', null, [getItem('Option 7', '7'), getItem('Option 8', '8')]),
    // ]),
    // {
    //     type: 'divider',
    // },
    // getItem('Navigation Three', 'sub4', () => h(SettingOutlined), [
    //     getItem('Option 9', '9'),
    //     getItem('Option 10', '10'),
    //     getItem('Option 11', '11'),
    //     getItem('Option 12', '12'),
    // ]),
    // getItem('Group', 'grp', null, [getItem('Option 13', '13'), getItem('Option 14', '14')], 'group'),
]);
const handleClick = e => {
    console.log('click', e);
};
watch(openKeys, val => {
    console.log('openKeys', val);
});
</script>

<style>
.menu {
  width: 14%; /* 改变宽度 */
  margin-top: 70px;
}

.menu .ant-menu-item-group-title{
    font-size: 20px; /* 调整字体大小 */
    text-align: center; /* 水平居中 */
}

.menu .ant-menu-title-content{
    font-size: 15px; /* 调整字体大小 */
    padding-left: 30px;
}
.menu .ant-menu-item-group-list .ant-menu-item{
    margin-top: 20px;
    height: 40px;
}
.menu .ant-menu-item-group-list .ant-menu-item .ant-menu-title-content{
    font-size: 15px;
}
</style>